home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / PInterfaces / IntlResources.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  12.6 KB  |  349 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        IntlResources.p
  3.  
  4.      Contains:    International Resource definitions.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT IntlResources;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __INTLRESOURCES__}
  30. {$SETC __INTLRESOURCES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC IntlResourcesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. CONST
  47. { Bits in the itlcFlags byte }
  48.     itlcShowIcon                = 7;                            {Show icon even if only one script}
  49.     itlcDualCaret                = 6;                            {Use dual caret for mixed direction text}
  50. { Bits in the itlcSysFlags word }
  51.     itlcSysDirection            = 15;                            {System direction - left to right/right to left}
  52.     tokLeftQuote                = 0;
  53.     tokRightQuote                = 1;
  54.     tokLeadPlacer                = 2;
  55.     tokLeader                    = 3;
  56.     tokNonLeader                = 4;
  57.     tokZeroLead                    = 5;
  58.     tokPercent                    = 6;
  59.     tokPlusSign                    = 7;
  60.     tokMinusSign                = 8;
  61.     tokThousands                = 9;
  62.     tokSeparator                = 11;                            {10 is a reserved field}
  63.     tokEscape                    = 12;
  64.     tokDecPoint                    = 13;
  65.     tokEPlus                    = 14;
  66.     tokEMinus                    = 15;
  67.     tokMaxSymbols                = 30;
  68.     curNumberPartsVersion        = 1;                            {current version of NumberParts record}
  69.  
  70.     currSymLead                    = 16;
  71.     currNegSym                    = 32;
  72.     currTrailingZ                = 64;
  73.     currLeadingZ                = 128;
  74.  
  75.     mdy                            = 0;
  76.     dmy                            = 1;
  77.     ymd                            = 2;
  78.     myd                            = 3;
  79.     dym                            = 4;
  80.     ydm                            = 5;
  81.  
  82.     
  83. TYPE
  84.     DateOrders = SInt8;
  85.  
  86.  
  87. CONST
  88.     timeCycle24                    = 0;                            {time sequence 0:00 - 23:59}
  89.     timeCycleZero                = 1;                            {time sequence 0:00-11:59, 0:00 - 11:59}
  90.     timeCycle12                    = 255;                            {time sequence 12:00 - 11:59, 12:00 - 11:59}
  91.     zeroCycle                    = 1;                            {old name for timeCycleZero}
  92.     longDay                        = 0;                            {day of the month}
  93.     longWeek                    = 1;                            {day of the week}
  94.     longMonth                    = 2;                            {month of the year}
  95.     longYear                    = 3;                            {year}
  96.     supDay                        = 1;                            {suppress day of month}
  97.     supWeek                        = 2;                            {suppress day of week}
  98.     supMonth                    = 4;                            {suppress month}
  99.     supYear                        = 8;                            {suppress year}
  100.     dayLdingZ                    = 32;
  101.     mntLdingZ                    = 64;
  102.     century                        = 128;
  103.     secLeadingZ                    = 32;
  104.     minLeadingZ                    = 64;
  105.     hrLeadingZ                    = 128;
  106.  
  107. { move OffsetTable to QuickdrawText }
  108.  
  109. TYPE
  110.     Intl0Rec = PACKED RECORD
  111.         decimalPt:                CHAR;                                    {decimal point character}
  112.         thousSep:                CHAR;                                    {thousands separator character}
  113.         listSep:                CHAR;                                    {list separator character}
  114.         currSym1:                CHAR;                                    {currency symbol}
  115.         currSym2:                CHAR;
  116.         currSym3:                CHAR;
  117.         currFmt:                UInt8;                                    {currency format flags}
  118.         dateOrder:                UInt8;                                    {order of short date elements: mdy, dmy, etc.}
  119.         shrtDateFmt:            UInt8;                                    {format flags for each short date element}
  120.         dateSep:                CHAR;                                    {date separator character}
  121.         timeCycle:                UInt8;                                    {specifies time cycle: 0..23, 1..12, or 0..11}
  122.         timeFmt:                UInt8;                                    {format flags for each time element}
  123.         mornStr:                PACKED ARRAY [1..4] OF CHAR;            {trailing string for AM if 12-hour cycle}
  124.         eveStr:                    PACKED ARRAY [1..4] OF CHAR;            {trailing string for PM if 12-hour cycle}
  125.         timeSep:                CHAR;                                    {time separator character}
  126.         time1Suff:                CHAR;                                    {trailing string for AM if 24-hour cycle}
  127.         time2Suff:                CHAR;
  128.         time3Suff:                CHAR;
  129.         time4Suff:                CHAR;
  130.         time5Suff:                CHAR;                                    {trailing string for PM if 24-hour cycle}
  131.         time6Suff:                CHAR;
  132.         time7Suff:                CHAR;
  133.         time8Suff:                CHAR;
  134.         metricSys:                UInt8;                                    {255 if metric, 0 if inches etc.}
  135.         intl0Vers:                INTEGER;                                {region code (hi byte) and version (lo byte)}
  136.     END;
  137.  
  138.     Intl0Ptr = ^Intl0Rec;
  139.     Intl0Hndl = ^Intl0Ptr;
  140.  
  141.     Intl1Rec = PACKED RECORD
  142.         days:                    ARRAY [1..7] OF Str15;                    {day names}
  143.         months:                    ARRAY [1..12] OF Str15;                    {month names}
  144.         suppressDay:            UInt8;                                    {255 for no day, or flags to suppress any element}
  145.         lngDateFmt:                UInt8;                                    {order of long date elements}
  146.         dayLeading0:            UInt8;                                    {255 for leading 0 in day number}
  147.         abbrLen:                UInt8;                                    {length for abbreviating names}
  148.         st0:                    PACKED ARRAY [1..4] OF CHAR;            {separator strings for long date format}
  149.         st1:                    PACKED ARRAY [1..4] OF CHAR;
  150.         st2:                    PACKED ARRAY [1..4] OF CHAR;
  151.         st3:                    PACKED ARRAY [1..4] OF CHAR;
  152.         st4:                    PACKED ARRAY [1..4] OF CHAR;
  153.         intl1Vers:                INTEGER;                                {region code (hi byte) and version (lo byte)}
  154.         localRtn:                ARRAY [0..0] OF INTEGER;                {now a flag for opt extension}
  155.     END;
  156.  
  157.     Intl1Ptr = ^Intl1Rec;
  158.     Intl1Hndl = ^Intl1Ptr;
  159.  
  160. {fields for optional itl1 extension}
  161.     Itl1ExtRec = RECORD
  162.         base:                    Intl1Rec;                                {un-extended Intl1Rec}
  163.         version:                INTEGER;
  164.         format:                    INTEGER;
  165.         calendarCode:            INTEGER;                                {calendar code for this itl1 resource}
  166.         extraDaysTableOffset:    LONGINT;                                {offset in itl1 to extra days table}
  167.         extraDaysTableLength:    LONGINT;                                {length of extra days table}
  168.         extraMonthsTableOffset:    LONGINT;                                {offset in itl1 to extra months table}
  169.         extraMonthsTableLength:    LONGINT;                                {length of extra months table}
  170.         abbrevDaysTableOffset:    LONGINT;                                {offset in itl1 to abbrev days table}
  171.         abbrevDaysTableLength:    LONGINT;                                {length of abbrev days table}
  172.         abbrevMonthsTableOffset: LONGINT;                                {offset in itl1 to abbrev months table}
  173.         abbrevMonthsTableLength: LONGINT;                                {length of abbrev months table}
  174.         extraSepsTableOffset:    LONGINT;                                {offset in itl1 to extra seps table}
  175.         extraSepsTableLength:    LONGINT;                                {length of extra seps table}
  176.         tables:                    ARRAY [0..0] OF INTEGER;                {now a flag for opt extension}
  177.     END;
  178.  
  179.     UntokenTable = RECORD
  180.         len:                    INTEGER;
  181.         lastToken:                INTEGER;
  182.         index:                    ARRAY [0..255] OF INTEGER;                {index table; last = lastToken}
  183.     END;
  184.  
  185.     UntokenTablePtr = ^UntokenTable;
  186.     UntokenTableHandle = ^UntokenTablePtr;
  187.  
  188.     WideChar = RECORD
  189.         CASE INTEGER OF
  190.         0: (
  191.             a:                            PACKED ARRAY [0..1] OF CHAR;        {0 is the high order character}
  192.            );
  193.         1: (
  194.             b:                            INTEGER;
  195.            );
  196.     END;
  197.  
  198.     WideCharArr = RECORD
  199.         size:                    INTEGER;
  200.         data:                    ARRAY [0..9] OF WideChar;
  201.     END;
  202.  
  203.     NumberParts = RECORD
  204.         version:                INTEGER;
  205.         data:                    PACKED ARRAY [0..30] OF WideChar;        {index by [tokLeftQuote..tokMaxSymbols]}
  206.         pePlus:                    WideCharArr;
  207.         peMinus:                WideCharArr;
  208.         peMinusPlus:            WideCharArr;
  209.         altNumTable:            WideCharArr;
  210.         reserved:                PACKED ARRAY [0..19] OF CHAR;
  211.     END;
  212.  
  213.     NumberPartsPtr = ^NumberParts;
  214.  
  215.     Itl4Rec = RECORD
  216.         flags:                    INTEGER;                                {reserved}
  217.         resourceType:            LONGINT;                                {contains 'itl4'}
  218.         resourceNum:            INTEGER;                                {resource ID}
  219.         version:                INTEGER;                                {version number}
  220.         resHeader1:                LONGINT;                                {reserved}
  221.         resHeader2:                LONGINT;                                {reserved}
  222.         numTables:                INTEGER;                                {number of tables, one-based}
  223.         mapOffset:                LONGINT;                                {offset to table that maps byte to token}
  224.         strOffset:                LONGINT;                                {offset to routine that copies canonical string}
  225.         fetchOffset:            LONGINT;                                {offset to routine that gets next byte of character}
  226.         unTokenOffset:            LONGINT;                                {offset to table that maps token to canonical string}
  227.         defPartsOffset:            LONGINT;                                {offset to default number parts table}
  228.         resOffset6:                LONGINT;                                {reserved}
  229.         resOffset7:                LONGINT;                                {reserved}
  230.         resOffset8:                LONGINT;                                {reserved}
  231.     END;
  232.  
  233.     Itl4Ptr = ^Itl4Rec;
  234.     Itl4Handle = ^Itl4Ptr;
  235.  
  236. { New NItl4Rec for System 7.0: }
  237.     NItl4Rec = RECORD
  238.         flags:                    INTEGER;                                {reserved}
  239.         resourceType:            LONGINT;                                {contains 'itl4'}
  240.         resourceNum:            INTEGER;                                {resource ID}
  241.         version:                INTEGER;                                {version number}
  242.         format:                    INTEGER;                                {format code}
  243.         resHeader:                INTEGER;                                {reserved}
  244.         resHeader2:                LONGINT;                                {reserved}
  245.         numTables:                INTEGER;                                {number of tables, one-based}
  246.         mapOffset:                LONGINT;                                {offset to table that maps byte to token}
  247.         strOffset:                LONGINT;                                {offset to routine that copies canonical string}
  248.         fetchOffset:            LONGINT;                                {offset to routine that gets next byte of character}
  249.         unTokenOffset:            LONGINT;                                {offset to table that maps token to canonical string}
  250.         defPartsOffset:            LONGINT;                                {offset to default number parts table}
  251.         whtSpListOffset:        LONGINT;                                {offset to white space code list}
  252.         resOffset7:                LONGINT;                                {reserved}
  253.         resOffset8:                LONGINT;                                {reserved}
  254.         resLength1:                INTEGER;                                {reserved}
  255.         resLength2:                INTEGER;                                {reserved}
  256.         resLength3:                INTEGER;                                {reserved}
  257.         unTokenLength:            INTEGER;                                {length of untoken table}
  258.         defPartsLength:            INTEGER;                                {length of default number parts table}
  259.         whtSpListLength:        INTEGER;                                {length of white space code list}
  260.         resLength7:                INTEGER;                                {reserved}
  261.         resLength8:                INTEGER;                                {reserved}
  262.     END;
  263.  
  264.     NItl4Ptr = ^NItl4Rec;
  265.     NItl4Handle = ^NItl4Ptr;
  266.  
  267.     TableDirectoryRecord = RECORD
  268.         tableSignature:            OSType;                                    {4 byte long table name }
  269.         reserved:                LONGINT;                                {Reserved for internal use }
  270.         tableStartOffset:        LONGINT;                                {Table start offset in byte}
  271.         tableSize:                LONGINT;                                {Table size in byte}
  272.     END;
  273.  
  274.     Itl5Record = RECORD
  275.         versionNumber:            Fixed;                                    {itl5 resource version number }
  276.         numberOfTables:            INTEGER;                                {Number of tables it contains }
  277.         reserved:                ARRAY [0..2] OF INTEGER;                {Reserved for internal use }
  278.         tableDirectory:            ARRAY [0..0] OF TableDirectoryRecord;    {Table directory records }
  279.     END;
  280.  
  281.     RuleBasedTrslRecord = RECORD
  282.         sourceType:                INTEGER;                                {Transliterate target type for the LHS of the rule }
  283.         targetType:                INTEGER;                                {Transliterate target type for the RHS of the rule }
  284.         formatNumber:            INTEGER;                                {Transliterate resource format number }
  285.         propertyFlag:            INTEGER;                                {Transliterate property flags }
  286.         numberOfRules:            INTEGER;                                {Number of rules following this field }
  287.     END;
  288.  
  289.     ItlcRecord = RECORD
  290.         itlcSystem:                INTEGER;                                {default system script}
  291.         itlcReserved:            INTEGER;                                {reserved}
  292.         itlcFontForce:            SInt8;                                    {default font force flag}
  293.         itlcIntlForce:            SInt8;                                    {default intl force flag}
  294.         itlcOldKybd:            SInt8;                                    {MacPlus intl keybd flag}
  295.         itlcFlags:                SInt8;                                    {general flags}
  296.         itlcIconOffset:            INTEGER;                                {keyboard icon offset; not used in 7.0}
  297.         itlcIconSide:            SInt8;                                    {keyboard icon side; not used in 7.0}
  298.         itlcIconRsvd:            SInt8;                                    {rsvd for other icon info}
  299.         itlcRegionCode:            INTEGER;                                {preferred verXxx code}
  300.         itlcSysFlags:            INTEGER;                                {flags for setting system globals}
  301.         itlcReserved4:            PACKED ARRAY [0..31] OF SInt8;            {for future use}
  302.     END;
  303.  
  304.     ItlbRecord = RECORD
  305.         itlbNumber:                INTEGER;                                {itl0 id number}
  306.         itlbDate:                INTEGER;                                {itl1 id number}
  307.         itlbSort:                INTEGER;                                {itl2 id number}
  308.         itlbFlags:                INTEGER;                                {Script flags}
  309.         itlbToken:                INTEGER;                                {itl4 id number}
  310.         itlbEncoding:            INTEGER;                                {itl5 ID # (optional; char encoding)}
  311.         itlbLang:                INTEGER;                                {current language for script }
  312.         itlbNumRep:                SInt8;                                    {number representation code}
  313.         itlbDateRep:            SInt8;                                    {date representation code }
  314.         itlbKeys:                INTEGER;                                {KCHR id number}
  315.         itlbIcon:                INTEGER;                                {ID # of SICN or kcs#/kcs4/kcs8 suite.}
  316.     END;
  317.  
  318. { New ItlbExtRecord structure for System 7.0 }
  319.     ItlbExtRecord = PACKED RECORD
  320.         base:                    ItlbRecord;                                {un-extended ItlbRecord}
  321.         itlbLocalSize:            LONGINT;                                {size of script's local record}
  322.         itlbMonoFond:            INTEGER;                                {default monospace FOND ID}
  323.         itlbMonoSize:            INTEGER;                                {default monospace font size}
  324.         itlbPrefFond:            INTEGER;                                {preferred FOND ID}
  325.         itlbPrefSize:            INTEGER;                                {preferred font size}
  326.         itlbSmallFond:            INTEGER;                                {default small FOND ID}
  327.         itlbSmallSize:            INTEGER;                                {default small font size}
  328.         itlbSysFond:            INTEGER;                                {default system FOND ID}
  329.         itlbSysSize:            INTEGER;                                {default system font size}
  330.         itlbAppFond:            INTEGER;                                {default application FOND ID}
  331.         itlbAppSize:            INTEGER;                                {default application font size}
  332.         itlbHelpFond:            INTEGER;                                {default Help Mgr FOND ID}
  333.         itlbHelpSize:            INTEGER;                                {default Help Mgr font size}
  334.         itlbValidStyles:        Style;                                    {set of valid styles for script}
  335.         itlbAliasStyle:            Style;                                    {style (set) to mark aliases}
  336.     END;
  337.  
  338.  
  339. {$ALIGN RESET}
  340. {$POP}
  341.  
  342. {$SETC UsingIncludes := IntlResourcesIncludes}
  343.  
  344. {$ENDC} {__INTLRESOURCES__}
  345.  
  346. {$IFC NOT UsingIncludes}
  347.  END.
  348. {$ENDC}
  349.